--proc them hoa don
ALTER proc [dbo].[addorder]
@MaHD nvarchar(200),
@MaDG nvarchar(200),
@MaSach nvarchar(200),
@MaNV nvarchar(200),
@NgayMuon date,
@NgayTra date
as
insert into HoaDon(MaHD,MaDG,MaSach,MaNV,NgayMuon,NgayTra)
values(@MaHD,@MaDG,@MaSach,@MaNV,@NgayMuon,@NgayTra)
go
--proc xoa hoa don
ALTER proc [dbo].[delorder]
@MaHD nvarchar(200)
as
delete hoadon where MaHD = @MaHD
go
--proc sua hoa don
ALTER proc [dbo].[editorder]
@MaHD nvarchar(200),
@MaDG nvarchar(200),
@MaSach nvarchar(200),
@MaNV nvarchar(200),
@NgayMuon date,
@NgayTra date
as
update hoadon
set
MaDG = @MaDG,
MaSach = @MaSach,
MaNV = @MaNV,
Ngaymuon=@NgayMuon,
ngaytra = @NgayTra
where
MaHD = @MaHD
go
--proc search by ID
ALTER proc [dbo].[searchbyID]
@MaHD nvarchar(200)
as
select * from HoaDon
where MaHD like '%' +@MaHD+ '%'
go
--proc search by ID khach hang
create proc searchbyIDdocgia
@MaDG nvarchar(200)
as
select * from HoaDon
where MaDG like '%' +@MaDG+ '%'
go